package com.shupian.domain.entity;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 文章表(Article)表实体类
 *
 * @author makejava
 * @since 2022-05-15 12:06:10
 */

@SuppressWarnings("serial")
@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@TableName("sg_article")

public class Article {

    @TableId
    private Long id;
    //标题

    private String title;
    //文章内容

    private String content;
    //文章摘要

    private String summary;
    //所属分类id

    private Long categoryId;
    //所属分类名

    @TableField(exist = false)
    private String categoryName;
    //缩略图

    private String thumbnail;
    //是否置顶（0否，1是）

    private String isTop;
    //状态（0已发布，1草稿）

    private String status;
    //访问量

    private Long viewCount;

    //是否允许评论 1是，0否
    private String isComment;

    @TableField(fill = FieldFill.INSERT)
    private Long createBy;
    @TableField(fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(fill = FieldFill.UPDATE)
    private Long updateBy;
    @TableField(fill = FieldFill.UPDATE)
    private Date updateTime;

    //删除标志（0 代表未删除，1 代表已删除）
    private Integer delFlag;


    public Article(Long id, long viewCount) {
        this.id=id;
        this.viewCount=viewCount;
    }
}

